package org.snail.common;

/**
 *
 * @author fish
 */
public class KeyValue<Key, Value> {

    private Key key;
    private Value value;

    public static <Key, Value> KeyValue<Key, Value> of(Key key, Value value) {
        return new KeyValue<>(key, value);
    }

    private KeyValue(Key key, Value value) {
        this.key = key;
        this.value = value;
    }

    public Key getKey() {
        return key;
    }

    public void setKey(Key key) {
        this.key = key;
    }

    public Value getValue() {
        return value;
    }

    public void setValue(Value value) {
        this.value = value;
    }

    @Override
    public String toString() {
        return "KeyValue{" + "key=" + key + ", value=" + value + '}';
    }
}
